import request from '@/utils/request'

// 查询工具信息列表
export function listTool(query) {
  return request({
    url: '/experiment/tool/list',
    method: 'get',
    params: query
  })
}

// 查询工具信息详细
export function getTool(toolId) {
  return request({
    url: '/experiment/tool/' + toolId,
    method: 'get'
  })
}

// 新增工具信息
export function addTool(data) {
  return request({
    url: '/experiment/tool',
    method: 'post',
    data: data
  })
}

// 修改工具信息
export function updateTool(data) {
  return request({
    url: '/experiment/tool',
    method: 'put',
    data: data
  })
}

// 删除工具信息
export function delTool(toolId) {
  return request({
    url: '/experiment/tool/' + toolId,
    method: 'delete'
  })
}

// 导出工具信息
export function exportTool(query) {
  return request({
    url: '/experiment/tool/export',
    method: 'get',
    params: query
  })
}
// 下载导入模板
export function importTemplate() {
  return request({
    url: '/experiment/tool/importTemplate',
    method: 'get'
  })
}

// 修改状态信息
export function changeState(equipmentId,state) {
  var data = {
    "ids" : equipmentId,
    "state" : state
  }
  return request({
    url: '/experiment/tool/changeState',
    method: 'post',
    data: data
  })
}

// 新增维修信息
export function addRepair(data) {
  return request({
    url: '/experiment/repair',
    method: 'post',
    data: data
  })
}

// 查询维修信息列表
export function listRepair(query) {
  return request({
    url: '/experiment/repair/repairList',
    method: 'get',
    params: query
  })
}